package com.ruoyi.workflow.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.workflow.domain.Statement;
import com.ruoyi.workflow.mapper.StatementMapper;
import com.ruoyi.workflow.service.IStatementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 结算单Service业务层处理
 * 
 * @author xiaodu
 * @date 2023-07-23
 */
@Service
public class StatementServiceImpl extends ServiceImpl<StatementMapper,Statement> implements IStatementService
{
    @Autowired
    private StatementMapper statementMapper;

    /**
     * 查询结算单
     * 
     * @param id 结算单主键
     * @return 结算单
     */
    @Override
    public Statement selectStatementById(Long id)
    {
        return statementMapper.selectStatementById(id);
    }

    /**
     * 查询结算单列表
     * 
     * @param statement 结算单
     * @return 结算单
     */
    @Override
    public List<Statement> selectStatementList(Statement statement)
    {
        return statementMapper.selectStatementList(statement);
    }

    /**
     * 新增结算单
     * 
     * @param statement 结算单
     * @return 结果
     */
    @Override
    public int insertStatement(Statement statement)
    {
        statement.setCreateTime(DateUtils.getNowDate());
        return statementMapper.insertStatement(statement);
    }

    /**
     * 修改结算单
     * 
     * @param statement 结算单
     * @return 结果
     */
    @Override
    public int updateStatement(Statement statement)
    {
        return statementMapper.updateStatement(statement);
    }

    /**
     * 批量删除结算单
     * 
     * @param ids 需要删除的结算单主键
     * @return 结果
     */
    @Override
    public int deleteStatementByIds(Long[] ids)
    {
        return statementMapper.deleteStatementByIds(ids);
    }

    /**
     * 删除结算单信息
     * 
     * @param id 结算单主键
     * @return 结果
     */
    @Override
    public int deleteStatementById(Long id)
    {
        return statementMapper.deleteStatementById(id);
    }


}

